﻿namespace _03.AnimalsExercise
{
    using System;
    using System.Linq;

    class AnimalsExercise
    {
        static void Main()
        {
            Animal[] animalsArray = {
                                    new Dog(1, "Sharo", Gender.Male),
                                    new Frog(2, "Kermit", Gender.Male),
                                    new Kitten(1, "Kitty"),
                                    new Tomcat(4, "Tom")
                                    };

            Console.WriteLine("Produce Sound: ");
            foreach (var animal in animalsArray)
            {
                animal.ProduceSound();
            }

            Dog[] dogsArray = {
                         new Dog(2, "Bethoven", Gender.Male),
                         new Dog(5, "Mara", Gender.Female),
                         new Dog(1, "Rex", Gender.Male)
                         };

            Console.WriteLine();
            Console.WriteLine("Average Age of dogs: {0:F2}", Dog.Average(dogsArray));
        }
    }
}
